package jpa.entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the Bestelling database table.
 * 
 */
@Embeddable
public class BestellingPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="best_id")
	private long bestId;

	@Column(name="klant_id")
	private long klantId;

	@Column(name="product_id")
	private long productId;

	private long aantal;

    public BestellingPK() {
    }
	public long getBestId() {
		return this.bestId;
	}
	public void setBestId(long bestId) {
		this.bestId = bestId;
	}
	public long getKlantId() {
		return this.klantId;
	}
	public void setKlantId(long klantId) {
		this.klantId = klantId;
	}
	public long getProductId() {
		return this.productId;
	}
	public void setProductId(long productId) {
		this.productId = productId;
	}
	public long getAantal() {
		return this.aantal;
	}
	public void setAantal(long aantal) {
		this.aantal = aantal;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof BestellingPK)) {
			return false;
		}
		BestellingPK castOther = (BestellingPK)other;
		return 
			(this.bestId == castOther.bestId)
			&& (this.klantId == castOther.klantId)
			&& (this.productId == castOther.productId)
			&& (this.aantal == castOther.aantal);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.bestId ^ (this.bestId >>> 32)));
		hash = hash * prime + ((int) (this.klantId ^ (this.klantId >>> 32)));
		hash = hash * prime + ((int) (this.productId ^ (this.productId >>> 32)));
		hash = hash * prime + ((int) (this.aantal ^ (this.aantal >>> 32)));
		
		return hash;
    }
}